package hk.m4s.lr.repair.test.ui.user;

import android.content.Context;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import framework.common.Constant;
import framework.common.baseui.UeBaseActivity;
import framework.common.zanetwork.core.ResponseCallback;
import framework.utils.SharedPreferencesUtils;
import hk.m4s.lr.repair.test.R;
import hk.m4s.lr.repair.test.model.JiangliModel;
import hk.m4s.lr.repair.test.model.MyOrderModel;
import hk.m4s.lr.repair.test.model.SmSModel;
import hk.m4s.lr.repair.test.ui.adapter.TimeLineAdapter;
import okhttp3.Response;

/**
 * Created by qi.wang on 2017/5/9.
 * 买家已经退货
 */

public class UserReturnGoodsActivity extends UeBaseActivity {
    private Context context;
    private TextView order_shop_name,order_shop_num,order_state;
    private ListView timelist;
    private MyOrderModel myOrderModel;
    private List<JiangliModel> jiangliList=new ArrayList<>();
    private TimeLineAdapter timeLineAdapter;
    private String jiangliName="";
    private List<SmSModel.ExpressBean.TracesBean> list=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        baseSetContentView(R.layout.activity_user_returngoods_handle);
        hiddenFooter();
        setTitleText("退货详情");
        context=this;
        showGoBackBtn();
        findBaseView();
        //findExpress();
    }
    public void findBaseView(){
        order_shop_name= (TextView) findViewById(R.id.order_shop_name);
        order_shop_num= (TextView) findViewById(R.id.order_shop_num);
        order_state= (TextView) findViewById(R.id.order_state);
        order_state.setText(getIntent().getStringExtra("titles"));
        timelist= (ListView) findViewById(R.id.timelist);
        timeLineAdapter = new TimeLineAdapter(this, list);
        timelist.setAdapter(timeLineAdapter);
    }
//    public void findExpress() {
//        Map<String, Object> parmas = new HashMap<>();
//        parmas.put("device_type", Constant.device_type);
//        parmas.put("token", SharedPreferencesUtils.getSharedPreferences(Constant.token, ""));
//        parmas.put("userId", SharedPreferencesUtils.getSharedPreferences(Constant.userId, ""));
//        MyService.findExpress(context, parmas, new ResponseCallback<SmSModel>() {
//            @Override
//            public void onSuccess(SmSModel userinfoModel) {
//                if(userinfoModel!=null) {
//                    if(userinfoModel.getExpress().getTraces()!=null){
//                        list.addAll(userinfoModel.getExpress().getTraces());
//                        timeLineAdapter.notifyDataSetChanged();
//                    }
//                }else{
//
//                }
//            }
//
//            @Override
//            public void onError(Response response, int errorCode, String errorMsg, Exception e) {
//
//            }
//        });
//    }
}
